package com.qf.util;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

/**
 * 2019/12/6
 * Administrator
 * springboot1206
 * 面向对象面向君  不负代码不负卿
 */
public class TimerTest {
    public static void main(String[] args) {
        //1.使用Timer实现任务调度
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("任务:"+new Date());
            }
        },3000,2000);


    }
}
